import 'package:flutter_app/utils/channel/CommonChannel.dart';
import 'package:flutter_app/utils/permission_utils.dart';

/**
 * @Description: 通知工具类
 * @Author: 下雨了
 * @CreateDate: 2021-12-24 11:03
 * @UpdateUser: 更新者
 * @UpdateDate:  2021-12-24 11:03
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
///
class NotificationUtils {
  // 私有构造函数
  NotificationUtils._internal();

  // 保存单例
  static final NotificationUtils _notificationUtils =  NotificationUtils._internal();

  // 工厂构造函数
  factory NotificationUtils() => _notificationUtils;

  /// 检查是否开启通知权限  ture 已开启
  Future<bool> notificationEnabled() async {
    return await PermissionUtils().getNotification();
  }

  /// 打开权限设置页面
  void openNotificationSettings() {
    // openAppSettings();
    CommonChannel.getInstance()?.openNotificationSettings();
  }
}
